#mysql数据库
docker run -p 2306:3306 --name mysql -v /Volumes/sandisk/data/mysql:/var/lib/mysql -v /Users/webusi/config/mysql:/etc/mysql/conf.d -v /Users/webusi/logs/mysql:/var/log/mysql -e MYSQL_ROOT_PASSWORD="123456" -d mysql:8.4.1

#postgres数据库
docker run -p 5432:5432 --name postgres -v /Volumes/sandisk/data/postgres:/var/lib/postgresql -e POSTGRES_PASSWORD="root" -d postgres:10.9


#minio 对象存储
docker run -d \
   -p 9900:9000 \
   -p 9901:9001 \
   --name minio \
   -v /Volumes/sandisk/data/minio:/data \
   -v /Users/webusi/config/minio:/root/.minio \
   -e MINIO_ROOT_USER="admin"  -e MINIO_ROOT_PASSWORD="minioadmin" \
   -e "TZ=Asia/Shanghai" \
   minio/minio:RELEASE.2024-07-31T05-46-26Z server /data --console-address ":9001"

#redis缓存
docker run -p 6379:6379 --log-opt max-size=100m --log-opt max-file=2 --name redis -v /Users/webusi/config/redis/redis.conf:/etc/redis/redis.conf -v /Volumes/sandisk/data/redis:/data -d redis:6.2.17 redis-server /etc/redis/redis.conf --appendonly yes

#elasticsearch 搜索引擎
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-v /Users/webusi/config/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /Users/webusi/data/elasticsearch:/usr/share/elasticsearch/data \
-v /Users/webusi/logs/elasticsearch:/usr/share/elasticsearch/logs \
-e ES_JAVA_OPTS="-Xms256m -Xmx512m" \
-e "discovery.type=single-node" -d elasticsearch:7.17.22

#openldap
#假设ip为：192.168.1.7
docker run -p 389:389 -p 636:636 \
--name ldap \
--volume /Users/webusi/data/ldap:/var/lib/ldap \
--volume /Users/webusi/config/ldap:/etc/ldap/slapd.d \
--env LDAP_ORGANISATION="manager" \
--env LDAP_DOMAIN="webusi.net" \
--env LDAP_BASE_DN="dc=webusi,dc=net" \
--env LDAP_ADMIN_PASSWORD="123456" \
-d osixia/openldap:stable

# 假设openldap的ip为：192.168.1.7
docker run --net host -d -p 8080:80 --name ldapadmin \
--env PHPLDAPADMIN_HTTPS=false --env PHPLDAPADMIN_LDAP_HOSTS=192.168.1.7 \
--env PHPLDAPADMIN_LDAP_BIND_DN="cn=admin,dc=webusi,dc=net" \
--env PHPLDAPADMIN_LDAP_BIND_PASSWORD=123456 \
--env PHPLDAPADMIN_LDAP_LOGIN_ATTRIBUTE=uid \
--env PHPLDAPADMIN_LDAP_BASE="dc=webusi,dc=net" \
--env PHPLDAPADMIN_LDAP_NAMING_RDN="cn=admin,dc=webusi,dc=net" \
--env PHPLDAPADMIN_LDAP_ANON_BIND='false' \
-d osixia/phpldapadmin:stable

#Nexus
docker run -d -p 8081:8081 \
--name nexus3 -e NEXUS_CONTEXT=nexus \
-e INSTALL4J_ADD_VM_PARAMS="-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m" \
-v /Users/webusi/data/nexus3:/nexus-data \
sonatype/nexus3:3.69.0-java11

#gogs
docker run --name=gogs -d -p 10022:22 -p 10880:3000 \
-v /Users/webusi/logs/gogs:/app/gogs/log \
-v /Users/webusi/data/gogs:/data gogs/gogs
